import { GSprite } from "../../../../com/mui/controls/GSprite";
import { UICompomentPool } from "../../../../com/mui/utils/UICompomentPool";
import { GBox } from "../../../../com/mui/containers/GBox";
import { GBoxDirection } from "../../../../com/mui/containers/globalVariable/GBoxDirection";
import { ObjCreate } from "../common/ObjCreate";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
type int = number;
//class StarItem
    
    export  class StarItem extends GSprite
    {
        constructor()
        {
            super();
            mouseChildren = false;
            mouseEnabled = false;
            return;
        }

        protected /* override */ createDisposedChildrenImpl(): void
        {
            super.createDisposedChildrenImpl();
            this._starBox = UICompomentPool.getUICompoment(GBox);
            this._starBox.horizontalGap = 2;
            this._starBox.direction = GBoxDirection.HORIZONTAL;
            addChild(this._starBox);
            this._awardValue = ObjCreate.createGTextField("", 140, 0, 60, 20, this);
            this._awardValue.textColor = 11661311;
            this._awardValue.selectable = false;
            this._awardValue.autoSize = flash.text.TextFieldAutoSize.LEFT;
            return;
        }

        protected /* override */ disposeImpl(arg1: Boolean=true): void
        {
            this._starBox.dispose(arg1);
            this._awardValue.dispose(arg1);
            super.disposeImpl(arg1);
            return;
        }

        public updateData(arg1: int, arg2: int, arg3: int=0): void
        {
            var loc2=null;
            this._starBox.disposeChild();
            var loc1=1;
            while (loc1 <= arg1) 
            {
                loc2 = GlobalClass.getBitmap("star_" + arg1);
                this._starBox.addChild(loc2);
                ++loc1;
            }
            this._starBox.invalidate();
            this._awardValue.htmlText = HTMLUtil.addColor("：" + arg2, "#b1efff");
            if (arg3 != 0) 
            {
                this._awardValue.htmlText = this._awardValue.htmlText + HTMLUtil.addColor(" +" + arg3, "#00ff00");
                this._awardValue.x = this._awardValue.x - 40;
            }
            return;
        }

        public /* override */ get height(): number
        {
            return 20;
        }

        /* internal */ /* var */_starBox: GBox;

        /* internal */ /* var */_awardValue: GTextFiled;
    }
